//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS Ivschat service.
///
///  Introduction  The Amazon IVS Chat control-plane API enables you to create and manage Amazon IVS Chat resources. You also need to integrate with the  Amazon IVS Chat Messaging API, to enable users to interact with chat rooms in real time. The API is an AWS regional service. For a list of supported regions and Amazon IVS Chat HTTPS service endpoints, see the Amazon IVS Chat information on the Amazon IVS page in the AWS General Reference.  This document describes HTTP operations. There is a separate messaging API for managing Chat resources; see the  Amazon IVS Chat Messaging API Reference.  Notes on terminology:    You create service applications using the Amazon IVS Chat API. We refer to these as applications.   You create front-end client applications (browser and Android/iOS apps) using the Amazon IVS Chat Messaging API. We refer to these as clients.     Resources  The following resources are part of Amazon IVS Chat:    LoggingConfiguration — A configuration that allows customers to store and record sent messages in a chat room. See the Logging Configuration endpoints for more information.    Room — The central Amazon IVS Chat resource through which clients connect to and exchange chat messages. See the Room endpoints for more information.    Tagging  A tag is a metadata label that you assign to an AWS resource. A tag comprises a key and a value, both set by you. For example, you might set a tag as topic:nature to label a particular video category. See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no service-specific constraints beyond what is documented there. Tags can help you identify and organize your AWS resources. For example, you can use the same tag for different resources to indicate that they are related. You can also use tags to manage access (see Access Tags). The Amazon IVS Chat API has these tag-related operations: TagResource, UntagResource, and ListTagsForResource. The following resource supports tagging: Room. At most 50 tags can be applied to a resource.  API Access Security  Your Amazon IVS Chat applications (service applications and clients) must be authenticated and authorized to access Amazon IVS Chat resources. Note the differences between these concepts:    Authentication is about verifying identity. Requests to the Amazon IVS Chat API must be signed to verify your identity.    Authorization is about granting permissions. Your IAM roles need to have permissions for Amazon IVS Chat API requests.   Users (viewers) connect to a room using secure access tokens that you create using the CreateChatToken operation through the AWS SDK. You call CreateChatToken for every user’s chat session, passing identity and authorization information about the user.  Signing API Requests  HTTP API requests must be signed with an AWS SigV4 signature using your AWS security credentials. The AWS Command Line Interface (CLI) and the AWS SDKs take care of signing the underlying API calls for you. However, if your application calls the Amazon IVS Chat HTTP API directly, it’s your responsibility to sign the requests. You generate a signature using valid AWS credentials for an IAM role that has permission to perform the requested action. For example, DeleteMessage requests must be made using an IAM role that has the ivschat:DeleteMessage permission. For more information:   Authentication and generating signatures — See Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon Web Services General Reference.   Managing Amazon IVS permissions — See Identity and Access Management on the Security page of the Amazon IVS User Guide.    Amazon Resource Names (ARNs)  ARNs uniquely identify AWS resources. An ARN is required when you need to specify a resource unambiguously across all of AWS, such as in IAM policies and API calls. For more information, see Amazon Resource Names in the AWS General Reference.
public struct Ivschat: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the Ivschat client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "Ivschat",
            serviceIdentifier: "ivschat",
            serviceProtocol: .restjson,
            apiVersion: "2020-07-14",
            endpoint: endpoint,
            errorType: IvschatErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Creates an encrypted token that is used by a chat participant to establish an individual WebSocket chat connection to a room. When the token is used to connect to chat, the connection is valid for the session duration specified in the request. The token becomes invalid at the token-expiration timestamp included in the response. Use the capabilities field to permit an end user to send messages or moderate a room. The attributes field securely attaches structured data to the chat session; the data is included within each message sent by the end user and received by other participants in the room. Common use cases for attributes include passing end-user profile data like an icon, display name, colors, badges, and other display features. Encryption keys are owned by Amazon IVS Chat and never used directly by your application.
    @Sendable
    @inlinable
    public func createChatToken(_ input: CreateChatTokenRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateChatTokenResponse {
        try await self.client.execute(
            operation: "CreateChatToken", 
            path: "/CreateChatToken", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an encrypted token that is used by a chat participant to establish an individual WebSocket chat connection to a room. When the token is used to connect to chat, the connection is valid for the session duration specified in the request. The token becomes invalid at the token-expiration timestamp included in the response. Use the capabilities field to permit an end user to send messages or moderate a room. The attributes field securely attaches structured data to the chat session; the data is included within each message sent by the end user and received by other participants in the room. Common use cases for attributes include passing end-user profile data like an icon, display name, colors, badges, and other display features. Encryption keys are owned by Amazon IVS Chat and never used directly by your application.
    ///
    /// Parameters:
    ///   - attributes: Application-provided attributes to encode into the token and attach to a chat session. Map keys and values can contain UTF-8 encoded text. The maximum length of this field is 1 KB total.
    ///   - capabilities: Set of capabilities that the user is allowed to perform in the room. Default: None (the capability to view messages is implicitly included in all requests).
    ///   - roomIdentifier: Identifier of the room that the client is trying to access. Currently this must be an ARN.
    ///   - sessionDurationInMinutes: Session duration (in minutes), after which the session expires. Default: 60 (1 hour).
    ///   - userId: Application-provided ID that uniquely identifies the user associated with this token. This can be any UTF-8 encoded text.
    ///   - logger: Logger use during operation
    @inlinable
    public func createChatToken(
        attributes: [String: String]? = nil,
        capabilities: [ChatTokenCapability]? = nil,
        roomIdentifier: String,
        sessionDurationInMinutes: Int? = nil,
        userId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateChatTokenResponse {
        let input = CreateChatTokenRequest(
            attributes: attributes, 
            capabilities: capabilities, 
            roomIdentifier: roomIdentifier, 
            sessionDurationInMinutes: sessionDurationInMinutes, 
            userId: userId
        )
        return try await self.createChatToken(input, logger: logger)
    }

    /// Creates a logging configuration that allows clients to store and record sent messages.
    @Sendable
    @inlinable
    public func createLoggingConfiguration(_ input: CreateLoggingConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateLoggingConfigurationResponse {
        try await self.client.execute(
            operation: "CreateLoggingConfiguration", 
            path: "/CreateLoggingConfiguration", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a logging configuration that allows clients to store and record sent messages.
    ///
    /// Parameters:
    ///   - destinationConfiguration: A complex type that contains a destination configuration for where chat content will be logged. There can be only one type of destination (cloudWatchLogs, firehose, or s3) in a destinationConfiguration.
    ///   - name: Logging-configuration name. The value does not need to be unique.
    ///   - tags: Tags to attach to the resource. Array of maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints on tags beyond what is documented there.
    ///   - logger: Logger use during operation
    @inlinable
    public func createLoggingConfiguration(
        destinationConfiguration: DestinationConfiguration,
        name: String? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateLoggingConfigurationResponse {
        let input = CreateLoggingConfigurationRequest(
            destinationConfiguration: destinationConfiguration, 
            name: name, 
            tags: tags
        )
        return try await self.createLoggingConfiguration(input, logger: logger)
    }

    /// Creates a room that allows clients to connect and pass messages.
    @Sendable
    @inlinable
    public func createRoom(_ input: CreateRoomRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateRoomResponse {
        try await self.client.execute(
            operation: "CreateRoom", 
            path: "/CreateRoom", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a room that allows clients to connect and pass messages.
    ///
    /// Parameters:
    ///   - loggingConfigurationIdentifiers: Array of logging-configuration identifiers attached to the room.
    ///   - maximumMessageLength: Maximum number of characters in a single message. Messages are expected to be UTF-8 encoded and this limit applies specifically to rune/code-point count, not number of bytes. Default: 500.
    ///   - maximumMessageRatePerSecond: Maximum number of messages per second that can be sent to the room (by all clients). Default: 10.
    ///   - messageReviewHandler: Configuration information for optional review of messages.
    ///   - name: Room name. The value does not need to be unique.
    ///   - tags: Tags to attach to the resource. Array of maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints beyond what is documented there.
    ///   - logger: Logger use during operation
    @inlinable
    public func createRoom(
        loggingConfigurationIdentifiers: [String]? = nil,
        maximumMessageLength: Int? = nil,
        maximumMessageRatePerSecond: Int? = nil,
        messageReviewHandler: MessageReviewHandler? = nil,
        name: String? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateRoomResponse {
        let input = CreateRoomRequest(
            loggingConfigurationIdentifiers: loggingConfigurationIdentifiers, 
            maximumMessageLength: maximumMessageLength, 
            maximumMessageRatePerSecond: maximumMessageRatePerSecond, 
            messageReviewHandler: messageReviewHandler, 
            name: name, 
            tags: tags
        )
        return try await self.createRoom(input, logger: logger)
    }

    /// Deletes the specified logging configuration.
    @Sendable
    @inlinable
    public func deleteLoggingConfiguration(_ input: DeleteLoggingConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteLoggingConfiguration", 
            path: "/DeleteLoggingConfiguration", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified logging configuration.
    ///
    /// Parameters:
    ///   - identifier: Identifier of the logging configuration to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteLoggingConfiguration(
        identifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteLoggingConfigurationRequest(
            identifier: identifier
        )
        return try await self.deleteLoggingConfiguration(input, logger: logger)
    }

    /// Sends an event to a specific room which directs clients to delete a specific message; that is, unrender it from view and delete it from the client’s chat history. This event’s EventName is aws:DELETE_MESSAGE. This replicates the  DeleteMessage WebSocket operation in the Amazon IVS Chat Messaging API.
    @Sendable
    @inlinable
    public func deleteMessage(_ input: DeleteMessageRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteMessageResponse {
        try await self.client.execute(
            operation: "DeleteMessage", 
            path: "/DeleteMessage", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Sends an event to a specific room which directs clients to delete a specific message; that is, unrender it from view and delete it from the client’s chat history. This event’s EventName is aws:DELETE_MESSAGE. This replicates the  DeleteMessage WebSocket operation in the Amazon IVS Chat Messaging API.
    ///
    /// Parameters:
    ///   - id: ID of the message to be deleted. This is the Id field in the received message (see  Message (Subscribe) in the Chat Messaging API).
    ///   - reason: Reason for deleting the message.
    ///   - roomIdentifier: Identifier of the room where the message should be deleted. Currently this must be an ARN.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteMessage(
        id: String,
        reason: String? = nil,
        roomIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteMessageResponse {
        let input = DeleteMessageRequest(
            id: id, 
            reason: reason, 
            roomIdentifier: roomIdentifier
        )
        return try await self.deleteMessage(input, logger: logger)
    }

    /// Deletes the specified room.
    @Sendable
    @inlinable
    public func deleteRoom(_ input: DeleteRoomRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteRoom", 
            path: "/DeleteRoom", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified room.
    ///
    /// Parameters:
    ///   - identifier: Identifier of the room to be deleted. Currently this must be an ARN.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteRoom(
        identifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteRoomRequest(
            identifier: identifier
        )
        return try await self.deleteRoom(input, logger: logger)
    }

    /// Disconnects all connections using a specified user ID from a room. This replicates the  DisconnectUser WebSocket operation in the Amazon IVS Chat Messaging API.
    @Sendable
    @inlinable
    public func disconnectUser(_ input: DisconnectUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DisconnectUserResponse {
        try await self.client.execute(
            operation: "DisconnectUser", 
            path: "/DisconnectUser", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Disconnects all connections using a specified user ID from a room. This replicates the  DisconnectUser WebSocket operation in the Amazon IVS Chat Messaging API.
    ///
    /// Parameters:
    ///   - reason: Reason for disconnecting the user.
    ///   - roomIdentifier: Identifier of the room from which the user's clients should be disconnected. Currently this must be an ARN.
    ///   - userId: ID of the user (connection) to disconnect from the room.
    ///   - logger: Logger use during operation
    @inlinable
    public func disconnectUser(
        reason: String? = nil,
        roomIdentifier: String,
        userId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DisconnectUserResponse {
        let input = DisconnectUserRequest(
            reason: reason, 
            roomIdentifier: roomIdentifier, 
            userId: userId
        )
        return try await self.disconnectUser(input, logger: logger)
    }

    /// Gets the specified logging configuration.
    @Sendable
    @inlinable
    public func getLoggingConfiguration(_ input: GetLoggingConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetLoggingConfigurationResponse {
        try await self.client.execute(
            operation: "GetLoggingConfiguration", 
            path: "/GetLoggingConfiguration", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the specified logging configuration.
    ///
    /// Parameters:
    ///   - identifier: Identifier of the logging configuration to be retrieved.
    ///   - logger: Logger use during operation
    @inlinable
    public func getLoggingConfiguration(
        identifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetLoggingConfigurationResponse {
        let input = GetLoggingConfigurationRequest(
            identifier: identifier
        )
        return try await self.getLoggingConfiguration(input, logger: logger)
    }

    /// Gets the specified room.
    @Sendable
    @inlinable
    public func getRoom(_ input: GetRoomRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetRoomResponse {
        try await self.client.execute(
            operation: "GetRoom", 
            path: "/GetRoom", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the specified room.
    ///
    /// Parameters:
    ///   - identifier: Identifier of the room for which the configuration is to be retrieved. Currently this must be an ARN.
    ///   - logger: Logger use during operation
    @inlinable
    public func getRoom(
        identifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetRoomResponse {
        let input = GetRoomRequest(
            identifier: identifier
        )
        return try await self.getRoom(input, logger: logger)
    }

    /// Gets summary information about all your logging configurations in the AWS region where the API request is processed.
    @Sendable
    @inlinable
    public func listLoggingConfigurations(_ input: ListLoggingConfigurationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListLoggingConfigurationsResponse {
        try await self.client.execute(
            operation: "ListLoggingConfigurations", 
            path: "/ListLoggingConfigurations", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets summary information about all your logging configurations in the AWS region where the API request is processed.
    ///
    /// Parameters:
    ///   - maxResults: Maximum number of logging configurations to return. Default: 50.
    ///   - nextToken: The first logging configurations to retrieve. This is used for pagination; see the nextToken response field.
    ///   - logger: Logger use during operation
    @inlinable
    public func listLoggingConfigurations(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListLoggingConfigurationsResponse {
        let input = ListLoggingConfigurationsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listLoggingConfigurations(input, logger: logger)
    }

    /// Gets summary information about all your rooms in the AWS region where the API request is processed. Results are sorted in descending order of updateTime.
    @Sendable
    @inlinable
    public func listRooms(_ input: ListRoomsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListRoomsResponse {
        try await self.client.execute(
            operation: "ListRooms", 
            path: "/ListRooms", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets summary information about all your rooms in the AWS region where the API request is processed. Results are sorted in descending order of updateTime.
    ///
    /// Parameters:
    ///   - loggingConfigurationIdentifier: Logging-configuration identifier.
    ///   - maxResults: Maximum number of rooms to return. Default: 50.
    ///   - messageReviewHandlerUri: Filters the list to match the specified message review handler URI.
    ///   - name: Filters the list to match the specified room name.
    ///   - nextToken: The first room to retrieve. This is used for pagination; see the nextToken response field.
    ///   - logger: Logger use during operation
    @inlinable
    public func listRooms(
        loggingConfigurationIdentifier: String? = nil,
        maxResults: Int? = nil,
        messageReviewHandlerUri: String? = nil,
        name: String? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListRoomsResponse {
        let input = ListRoomsRequest(
            loggingConfigurationIdentifier: loggingConfigurationIdentifier, 
            maxResults: maxResults, 
            messageReviewHandlerUri: messageReviewHandlerUri, 
            name: name, 
            nextToken: nextToken
        )
        return try await self.listRooms(input, logger: logger)
    }

    /// Gets information about AWS tags for the specified ARN.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about AWS tags for the specified ARN.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the resource to be retrieved. The ARN must be URL-encoded.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Sends an event to a room. Use this within your application’s business logic to send events to clients of a room; e.g., to notify clients to change the way the chat UI is rendered.
    @Sendable
    @inlinable
    public func sendEvent(_ input: SendEventRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> SendEventResponse {
        try await self.client.execute(
            operation: "SendEvent", 
            path: "/SendEvent", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Sends an event to a room. Use this within your application’s business logic to send events to clients of a room; e.g., to notify clients to change the way the chat UI is rendered.
    ///
    /// Parameters:
    ///   - attributes: Application-defined metadata to attach to the event sent to clients. The maximum length of the metadata is 1 KB total.
    ///   - eventName: Application-defined name of the event to send to clients.
    ///   - roomIdentifier: Identifier of the room to which the event will be sent. Currently this must be an ARN.
    ///   - logger: Logger use during operation
    @inlinable
    public func sendEvent(
        attributes: [String: String]? = nil,
        eventName: String,
        roomIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> SendEventResponse {
        let input = SendEventRequest(
            attributes: attributes, 
            eventName: eventName, 
            roomIdentifier: roomIdentifier
        )
        return try await self.sendEvent(input, logger: logger)
    }

    /// Adds or updates tags for the AWS resource with the specified ARN.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds or updates tags for the AWS resource with the specified ARN.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the resource to be tagged. The ARN must be URL-encoded.
    ///   - tags: Array of tags to be added or updated. Array of maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints beyond what is documented there.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes tags from the resource with the specified ARN.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes tags from the resource with the specified ARN.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the resource to be untagged. The ARN must be URL-encoded.
    ///   - tagKeys: Array of tags to be removed. Array of maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints beyond what is documented there.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates a specified logging configuration.
    @Sendable
    @inlinable
    public func updateLoggingConfiguration(_ input: UpdateLoggingConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateLoggingConfigurationResponse {
        try await self.client.execute(
            operation: "UpdateLoggingConfiguration", 
            path: "/UpdateLoggingConfiguration", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a specified logging configuration.
    ///
    /// Parameters:
    ///   - destinationConfiguration: A complex type that contains a destination configuration for where chat content will be logged. There can be only one type of destination (cloudWatchLogs, firehose, or s3) in a destinationConfiguration.
    ///   - identifier: Identifier of the logging configuration to be updated.
    ///   - name: Logging-configuration name. The value does not need to be unique.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateLoggingConfiguration(
        destinationConfiguration: DestinationConfiguration? = nil,
        identifier: String,
        name: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateLoggingConfigurationResponse {
        let input = UpdateLoggingConfigurationRequest(
            destinationConfiguration: destinationConfiguration, 
            identifier: identifier, 
            name: name
        )
        return try await self.updateLoggingConfiguration(input, logger: logger)
    }

    /// Updates a room’s configuration.
    @Sendable
    @inlinable
    public func updateRoom(_ input: UpdateRoomRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateRoomResponse {
        try await self.client.execute(
            operation: "UpdateRoom", 
            path: "/UpdateRoom", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a room’s configuration.
    ///
    /// Parameters:
    ///   - identifier: Identifier of the room to be updated. Currently this must be an ARN.
    ///   - loggingConfigurationIdentifiers: Array of logging-configuration identifiers attached to the room.
    ///   - maximumMessageLength: The maximum number of characters in a single message. Messages are expected to be UTF-8 encoded and this limit applies specifically to rune/code-point count, not number of bytes. Default: 500.
    ///   - maximumMessageRatePerSecond: Maximum number of messages per second that can be sent to the room (by all clients). Default: 10.
    ///   - messageReviewHandler: Configuration information for optional review of messages. Specify an empty uri string to disassociate a message review handler from the specified room.
    ///   - name: Room name. The value does not need to be unique.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateRoom(
        identifier: String,
        loggingConfigurationIdentifiers: [String]? = nil,
        maximumMessageLength: Int? = nil,
        maximumMessageRatePerSecond: Int? = nil,
        messageReviewHandler: MessageReviewHandler? = nil,
        name: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateRoomResponse {
        let input = UpdateRoomRequest(
            identifier: identifier, 
            loggingConfigurationIdentifiers: loggingConfigurationIdentifiers, 
            maximumMessageLength: maximumMessageLength, 
            maximumMessageRatePerSecond: maximumMessageRatePerSecond, 
            messageReviewHandler: messageReviewHandler, 
            name: name
        )
        return try await self.updateRoom(input, logger: logger)
    }
}

extension Ivschat {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: Ivschat, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension Ivschat {
    /// Return PaginatorSequence for operation ``listLoggingConfigurations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listLoggingConfigurationsPaginator(
        _ input: ListLoggingConfigurationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListLoggingConfigurationsRequest, ListLoggingConfigurationsResponse> {
        return .init(
            input: input,
            command: self.listLoggingConfigurations,
            inputKey: \ListLoggingConfigurationsRequest.nextToken,
            outputKey: \ListLoggingConfigurationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listLoggingConfigurations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Maximum number of logging configurations to return. Default: 50.
    ///   - logger: Logger used for logging
    @inlinable
    public func listLoggingConfigurationsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListLoggingConfigurationsRequest, ListLoggingConfigurationsResponse> {
        let input = ListLoggingConfigurationsRequest(
            maxResults: maxResults
        )
        return self.listLoggingConfigurationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listRooms(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listRoomsPaginator(
        _ input: ListRoomsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListRoomsRequest, ListRoomsResponse> {
        return .init(
            input: input,
            command: self.listRooms,
            inputKey: \ListRoomsRequest.nextToken,
            outputKey: \ListRoomsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listRooms(_:logger:)``.
    ///
    /// - Parameters:
    ///   - loggingConfigurationIdentifier: Logging-configuration identifier.
    ///   - maxResults: Maximum number of rooms to return. Default: 50.
    ///   - messageReviewHandlerUri: Filters the list to match the specified message review handler URI.
    ///   - name: Filters the list to match the specified room name.
    ///   - logger: Logger used for logging
    @inlinable
    public func listRoomsPaginator(
        loggingConfigurationIdentifier: String? = nil,
        maxResults: Int? = nil,
        messageReviewHandlerUri: String? = nil,
        name: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListRoomsRequest, ListRoomsResponse> {
        let input = ListRoomsRequest(
            loggingConfigurationIdentifier: loggingConfigurationIdentifier, 
            maxResults: maxResults, 
            messageReviewHandlerUri: messageReviewHandlerUri, 
            name: name
        )
        return self.listRoomsPaginator(input, logger: logger)
    }
}

extension Ivschat.ListLoggingConfigurationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Ivschat.ListLoggingConfigurationsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension Ivschat.ListRoomsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Ivschat.ListRoomsRequest {
        return .init(
            loggingConfigurationIdentifier: self.loggingConfigurationIdentifier,
            maxResults: self.maxResults,
            messageReviewHandlerUri: self.messageReviewHandlerUri,
            name: self.name,
            nextToken: token
        )
    }
}
